ajFIXValidation function
Available since AlchemyJ v5.0
Description
The ajFIXValidation function is used to check the FIX message is valid or not before performing some operations on it. Such as transfer the FIX message to JSON format. when the validation failed it will return the details error message. It only support SOH delimiter in the message. This is the example for FIX message.
8=FIX.4.29=16835=834=149=TRADETECH56=COMPASS52=20240730-15:55:12.456150=039=037=20240731-00117=20240730155512-00148=AAPL22=854=11=ACC00138=100014=0151=10006=015=USD10=219
Syntax
ajFIXValidation(message,[version],[run_condition],[run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
message (required) | Range | Specify content of the FIX message from a range of cells. One FIX message can span multiple rows and columns, and the content in cells are concatenated into one string from left to right and top to bottom. |
version (optional) | String | Supported versions: FIX.4.2, FIX.4.3, FIX.4.4, FIX.5.0, FIX.5.0SP1, FIX.5.0SP2. The default value is FIX.5.0SP2. |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through Excel Calculation (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
1) Return Value: JSON string.
2) Return Type: Single Value
Example
Make sure the AlchemyJ Function Proxy was started up when executing ajFIXValidation in the AlchemyJ workbook. You can start the proxy from More Tools - Run AlchemyJ Function Proxy.
Example 1
In this example, the status is returned true without error message means the message validation pass.
Example 2
In this example, FIX message is missing a required tag 98. The verify result is false with meaningful error message.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
FIX message version is not support. |
FIX message is empty. |